package com.lxp.modules.gyy.controller;

import com.lxp.common.core.domain.AjaxResult;
import com.lxp.modules.gyy.domain.HrDepartment;
import com.lxp.modules.gyy.domain.HrEmployee;
import com.lxp.modules.gyy.domain.ProjectTask;
import com.lxp.modules.gyy.domain.vo.EmpParam;
import com.lxp.modules.gyy.domain.vo.TaskParam;
import com.lxp.modules.gyy.service.HrDepartmentService;
import com.lxp.modules.gyy.service.HrEmployeeService;
import com.lxp.modules.gyy.service.ProjectTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/gyy/task")
@Api(tags = "工业云任务接口")
@Slf4j
public class ProjectTaskController {
    @Resource
    private ProjectTaskService projectTaskService;

    @ApiOperation("根据用户id查询任务")
    @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = ProjectTask.class)))
    @PostMapping("/getTaskByUserId")
    public AjaxResult getTaskByUserId(@RequestBody TaskParam param) {
        List<ProjectTask> list = projectTaskService.getList(param);
        return AjaxResult.success(list);
    }

}
